﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;

namespace NakovBlog
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IService1" in both code and config file together.
    [ServiceContract]
    public interface IBlogService
    {
        [OperationContract]
        [WebInvoke(Method = "GET", UriTemplate = "Blogs")]
        List<BlogDTO> GetBlogs();

        [OperationContract]
        [WebInvoke(Method = "POST", UriTemplate = "Comnets")]
        BlogDTO GetSingleblog(ComentsContractor contractor);

        [OperationContract]
        [WebInvoke(Method = "POST", UriTemplate = "PostComment")]
        void AddComent(ComentDTO coment);
    }
    [DataContract]
    public class BlogContractor 
    {
        [DataMember]
        public int numberOfBlogs{ get; set; }
        [DataMember]
        public int numberOfChars{ get; set; }
    }

    [DataContract]
    public class ComentsContractor 
    {
        [DataMember]
        public int blogId{ get; set; }
        [DataMember]
        public int numberOfMessages{ get; set; }
    }
}
